//*********************************************************
//
// Output Registers used:
//   oPos - The vertex output position.
//   oT0  - UV for normal map
//   oD0  - Light direction in tangentspace
//
//*********************************************************

// oPos = MVP * position
m4x4 r0, inPos, c[MODEL_VIEW_PROJECTION]
mov oPos, r0

// oT0 = texcoord
mov oT0, inUV

// r4 = TangentMatrix[-1] * LightDir
dp3  r4.x, v3, c[VL_MODEL_SPACE_LIGHT_DIR_SHADOWLENGTH]
dp3  r4.y, v4, c[VL_MODEL_SPACE_LIGHT_DIR_SHADOWLENGTH]
dp3  r4.z, inNormal, c[VL_MODEL_SPACE_LIGHT_DIR_SHADOWLENGTH]
mov oD0, r4.xyz
